package io.bdmc.common.utils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 常量
 * 
 * @author huang lu
 * @email hlkyo@qq.com
 * @date 2016年11月15日 下午1:23:52
 */
@Component
public class Constant {
    /** 超级管理员ID */
    public static final int SUPER_ADMIN = 1;

    public static String EXPORTPATH;// 导出路径文件夹

    public static String ftpIp;

    public static String ftpPort;

    public static String ftpUserName;

    public static String ftpPassword;

    public static final int ACTION_AutoTest = 1;// 自动测试

    public static final int ACTION_StopTest = 2;// 停止测试

    public static final int ACTION_ManualTest = 3;// 手动测试

    public static final String ALARM_Loss = "LOSS";// 衰耗报警

    public static final String ALARM_Distance = "CH";// 长度报警

    public static final String ALARM_Module = "MD";// 模块报警

    public static final String ALARM_Power = "POWER";// 电源报警

    public static final String ALARM_Temp = "TEMP";// 温度报警

    public static final String ALARM_Network = "NETWORK";// 网络报警

    public static final String ALARM_Fan = "FAN";// 风扇报警

    /**
     * 正在自动测试的通道集合
     */
    public static final String MeasureNowMapPrefix = "MeasureNowMapPrefix";

    /**
     * 周期测试间隔时间缓存前缀
     */
    public static final String AutoMeasureInterval = "AutoMeasureInterval:";

    public static final String MSP2000MeasureNowMapPrefix = "MSP2000MeasureNowMapPrefix:";

    public static final String MSP2000FMSAlarmProcessPrefix = "MSP2000FMSAlarmProcessPrefix:";
    /**
     * opm告警，需要驱动测试的otdr设备和端口
     */
    // public static final String MSP2000NeedMeasureOTDRPrefix =
    // "MSP2000NeedMeasureOTDRPrefix";

    /**
     * 当前所有设备的静态数据
     */
    public static final String DeviceStatusStaticPrefix = "DeviceStatusStaticPrefix:";

    /**
     * 设备通道的实时数据，长度和衰耗
     */
    public static final String DeviceChannelRealtimePrefix = "DeviceChannelRealtimePrefix:";

    /**
     * 162端口的启动状态
     */
    public static final String Is162Startup = "Is162Startup";

    /**
     * 缓存的获取的最后一次动态监测数据
     */
    public static final String DeviceMonitorDynamicPrefix = "DeviceMonitorDynamicPrefix";

    /**
     * 路由自动测试时间缓存前缀
     */
    public static final String FmsDeviceAutoMeasureTime = "FmsDeviceAutoMeasureTime";

    // 路由otdr告警次数
    public static final String routeOTDRAlarmTimes = "RouteOTDRAlarmTimes:";

    public static final String IFMS1000 = "IFMS-1000";

    public static final String MSP2000 = "MSP-2000";

    public static final String EU = "1U";

    public static final String FU = "4U";

    public static final String DTS = "DTS";

    public static final String NMS = "NMS";

    public static final String DTSConfigPath = "/dts/";

    public static final String FMS = "FMS";

    public static final String FMSA = "FMS-A";

    public static final String FMSM = "FMS-M";

    @Value("${myconfig.exportPath}")
    public void setExportPath(String exportPath) {
        EXPORTPATH = exportPath;
    }

    /**
     * 菜单类型
     * 
     * @author huang lu
     * @email hlkyo@qq.com
     * @date 2016年11月15日 下午1:24:29
     */
    public enum MenuType {
        /**
         * 目录
         */
        CATALOG(0),
        /**
         * 菜单
         */
        MENU(1),
        /**
         * 页面
         */
        PAGE(2),
        /**
         * 按钮
         */
        BUTTON(3);

        private int value;

        private MenuType(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }
    }

    /**
     * 定时任务状态
     * 
     * @author huang lu
     * @email hlkyo@qq.com
     * @date 2016年12月3日 上午12:07:22
     */
    public enum ScheduleStatus {
        /**
         * 正常
         */
        NORMAL(0),
        /**
         * 暂停
         */
        PAUSE(1);

        private int value;

        private ScheduleStatus(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }
    }

    public static enum ModifyName {
        ADD, UPDATE, DELETE, GET, None;
    }

}
